package com.aerfafish.spider.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author aerfafish
 * @date 2020/12/17 5:11 下午
 */
public class DateUtil {


    private static DateFormat format = new SimpleDateFormat("yyyy/MM/dd");

    private final static Logger logger = LoggerFactory.getLogger(DateUtil.class);

    public static Date parseDate(String dateString) {
        try {
            Date date = format.parse(dateString);
            return date;
        } catch (ParseException e) {
            logger.error("", e);
        }
        return null;
    }
}
